//
//  YZMAnswerViewController.m
//  YZMicroStock
//
//  Created by apple on 2018/3/5.
//  Copyright © 2018年 cqjr. All rights reserved.
//

#import "YZMAnswerViewController.h"
#import "YZMAnswerTableViewCell.h"

@interface YZMAnswerViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView* tableView;

@end

@implementation YZMAnswerViewController

- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - (iPhoneX? 88+83 : 64+49)) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
//        [_tableView registerNib:[UINib nibWithNibName:@"YZMAnswerTableViewCell" bundle:nil] forCellReuseIdentifier:@"id"];
    }
    return _tableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"答疑";
    [self.view addSubview:self.tableView];
    
    UIButton* put = [UIButton buttonWithType:UIButtonTypeCustom];
    put.frame = CGRectMake(ScreenWidth - 70, self.tableView.frame.size.height - 100, 50, 50);
    [put setTitle:@"" forState:UIControlStateNormal];
    put.backgroundColor = [UIColor redColor];
    [self.view addSubview:put];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    YZMAnswerTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"id"];
    if (!cell) {
        cell = initNib(YZMAnswerTableViewCell)
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}


@end
